import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22652
 * Date: 2024-04-25
 * Time: 11:20
 */
public class Dome_03 {
    public static void main(String[] args) {
        int[] num = {6, 0, 2, 0, 4};
        System.out.println(Arrays.toString(num));
        System.out.println(IsContinuous(num));

    }

    public static boolean IsContinuous(int[] numbers) {
        Arrays.sort(numbers);
        int flag = 1;
        int zero = 0;
        for (int i = 0; i < numbers.length; i++) {
            if (numbers[i] == 0) {
                zero++;
            }
        }
        int falsenum=0;
       for (int i = zero+1; i < numbers.length; i++) {
           if(numbers[i]==numbers[i-1])
               return false;
            if (numbers[i] - numbers[i - 1] != 1) {
                falsenum += numbers[i] - numbers[i - 1]-1;
                flag = 0;
            }
        }
        if (zero>=falsenum) {
                flag = 1;
            }
        if (flag == 1) {
            return true;
        } else {
            return false;
        }
    }
}
